package com.michael.demos.springboot.openapi.service;

import lombok.Getter;

/**
 * 类功能描述:
 * <pre>
 *   错误编码
 * </pre>
 *
 * @author Michael
 * @version 1.0
 * @date 2020/11/26 17:38
 */
@Getter
public enum ErrorCode {

    USER_NONE(1001, "用户不存在"),
    WRONG_SECRET(1002, "secret错误"),
    TOKEN_EXPIRED(1003, "token 失效"),
    REPEATED_REQ(1004, "重复的请求"),
    TIMESTAMP_ERROR(1005, "时间戳错误"),
    TIME_EXPIRED(1006, "请求超时"),
    SIGN_ERROR(1007, "签名错误"),
    SERVER_ERROR(9999, "签名出错[服务器错误]"),
    ;

    private final Integer code;
    private final String msg;

    ErrorCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
